import java.util.HashMap;


public class Hashtable implements WordSet{
    
    private HashMap<String, String> HashTable;
    
    public Hashtable(){
        HashTable = new HashMap();
    }
    
    /**
     *
     * @param wordObject
     */
    @Override
    public void add(Word word) {
        HashTable.put(word.getWord(),word.getType() );
         }

    /**
     *
     * @param word
     * @return
     */
    @Override
    public Word get(Word word) {
        if (!(HashTable.containsKey(word.getWord())))
            return null;
        return new Word(word.getWord(),HashTable.get(word.getWord()));
         }
}